From 42412705bfb8a12814b747ce1d0eade5756b3f95 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Tue, 14 Nov 2006 06:30:43 +0000 Subject: [PATCH] (mh-x-image-url-cache-canonicalize): Add `*' to reserved Windows filename characters (closes SF #1396499). --- lisp/mh-e/mh-xface.el | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el index deb2cebad14..e6da73339c1 100644 --- a/lisp/mh-e/mh-xface.el +++ b/lisp/mh-e/mh-xface.el @@ -361,14 +361,16 @@ This is only done if `mh-x-image-cache-directory' is nil." Replace the ?/ character with a ?! character and append .png. Also replaces special characters with `mh-url-hexify-string' since not all characters, such as :, are legal within Windows -filenames. See URL -`http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp'." +filenames. In addition, replaces * with %2a. See URL +`http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iitemnamelimits/GetValidCharacters.asp'." (format "%s/%s.png" mh-x-image-cache-directory - (mh-url-hexify-string - (with-temp-buffer - (insert url) - (mh-replace-string "/" "!") - (buffer-string))))) + (mh-replace-regexp-in-string + "\*" "%2a" + (mh-url-hexify-string + (with-temp-buffer + (insert url) + (mh-replace-string "/" "!") + (buffer-string)))))) (defun mh-x-image-get-download-state (file) "Check the state of FILE by following any symbolic links." -- 2.30.2